<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="container"></div>
</body>
<script>
    let dom = document.getElementById('container')
    let divnode = document.createElement('span')
    
    function fn(cb) {
        setInterval(cb, 1000)
    }
    fn(() => {
        let textnode = document.createTextNode('🐻')
        divnode.appendChild(textnode)
        dom.appendChild(divnode)
    })

    var obj = {
        array: [1, 2, 3, 4],
        sum: function() {
            console.log(this === window)
            return this.array.reduce((total, item, index) => {
                console.log(total, item, index)
                return item + 10
            } )
        }
    }
    console.log(obj.sum())

</script>
</html>
